package com.test39_集合应用.vo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 部门
 */
public class Dept implements Serializable {
    private Long deptno;
    private String name;
    private Company company;
    private Map<Long, Emp> emps;

    public Dept() {
        this(null, null);
    }

    public Dept(Long deptno, String name) {
        this.deptno = deptno;
        this.name = name;
        this.emps = new HashMap<>();
    }

    public Long getDeptno() {
        return deptno;
    }

    public void setDeptno(Long deptno) {
        this.deptno = deptno;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public Map<Long, Emp> getEmps() {
        return emps;
    }

    public void setEmps(Map<Long, Emp> emps) {
        this.emps = emps;
    }

    @Override
    public String toString() {
        return "【Dept】部门编号：" + this.deptno + "、部门名称：" + this.name + "、部门人数：" + this.emps.size();
    }
}
